home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / WADDSTR.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  58 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef waddstr
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_waddstr = "$Header: c:/curses/portable/RCS/waddstr.c%v 2.0 1992/11/15 03:29:21 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   waddstr()    - add string to window
  15.  
  16.   X/Open Description:
  17.        These routines write all the characters of the null-terminated
  18.        string str on the given window.  The functionality is equivalent
  19.        to calling waddch() once for each character in the string.
  20.  
  21.        NOTE:  addstr(), mvaddstr(), and mvwaddstr() are macros.
  22.  
  23.   PDCurses Description:
  24.        The *raw*() routines output 8 bit values.  These contrast to their
  25.        normal counterparts which output 7 bit values and convert control
  26.        character to the ^X notation.
  27.  
  28.        str is a standard 8 bit character string WITHOUT embedded attributes.
  29.  
  30.   X/Open Return Value:
  31.        The waddstr() function returns OK on success and ERR on error.
  32.  
  33.   PDCurses Errors:
  34.        It is an error to call this function with a NULL window pointer.
  35.  
  36.   Portability:
  37.        PDCurses        int waddstr( WINDOW* win, char* str );
  38.        X/Open Dec '88  int waddstr( WINDOW* win, char* str );
  39.        BSD Curses      int waddstr( WINDOW* win, char* str );
  40.        SYS V Curses    int waddstr( WINDOW* win, char* str );
  41.  
  42. **man-end**********************************************************************/
  43.  
  44. int    waddstr(WINDOW *win, char *str)
  45. {
  46.        if (win == (WINDOW *)NULL)
  47.                return( ERR );
  48.  
  49.        while (*str)
  50.        {
  51.                if (waddch(win, *str++) == ERR)
  52.                {
  53.                        return( ERR );
  54.                }
  55.        }
  56.        return( OK );
  57. }
  58.